<section class="section {page->class}">
	<h2 class="hide">{page->title}</h2>
	<script>
		$(function() {
			// 카테고리 추가
			$("section.category .button_area .category_add").button().click(function() {
				var href = $(this).attr("href");
				
				loadDialogForm(href, null, "{bid} 카테고리 "+ $(this).text(), 500, 160, null, 'category_add');
				return false;
			});
			
			// 카테고리 수정
			$("section.category a.category_modify").click(function() {
				var href = $(this).attr("href");
				
				loadDialogForm(href, null, "{bid} 카테고리 "+ $(this).text(), 500, 160, null, 'category_modify');
				
				return false;
			});
			
			// 카테고리 삭제
			$("section.category a.category_delete").click(function() {
				if(confirm('해당 카테고리를 삭제하시겠습니까?')) {
					$.ajax({
						 url : $(this).attr("href")
						,success:function(data){
							if(data.code == mesg.success) {
								_loadDialogFormName('category').load(data.return_url);
							} else {
								alert(data.msg);
							}
							
							return false;
						}
					});
					
				} 
				
				return false;
			});
		});
	</script>
	<table class="table">
		<caption>
			{page->title}
		</caption>
		<colgroup>
			<col class="t_chk" />
			<col />
			<col class="t_board_count" />
			<col class="t_board_count" />
			<col class="t_date" />
			<col class="t_etc" />
		</colgroup>
		<thead>
			<tr>
				<th scope="col"><input type="checkbox" name="chk[]" /></th>
				<th scope="col">카테고리명</th>
				<th scope="col">정렬값</th>
				<th scope="col">총게시물</th>
				<th scope="col">생성일</th>
				<th scope="col">비고</th>
			</tr>
		</thead>
		<tbody>
			{? list}
				{@ list}
			<tr>
				<td class="txt_center"><input type="checkbox" name="chk[]" /></td>
				<td>
					{.value_->bc_name}
				</td>
				<td class="txt_center">{.value_->bc_order}</td>
				<td class="txt_center">{.value_->bc_count}</td>
				<td class="txt_center">{.value_->date}</td>
				<td class="txt_center">
					<a href="{action}/categoryModify/{.value_->ba_seq}/{.value_->bc_seq}" class="category_modify">
						<img src="{CFG->PATH->IMAGE}/icons/pencil.png" alt="수정" />
					</a>
					{? .value_->bc_delete != 0}
					&nbsp;
					<a href="{action}/doCategoryDelete/{.value_->ba_seq}/{.value_->bc_seq}" class="category_delete">
						<img src="{CFG->PATH->IMAGE}/icons/delete.png" alt="삭제" />
					</a>
					{/}
				</td>
			</tr>
				{/}
			{:}
			<tr>
				<td colspan="6" class="txt_center no_data">
					등록된 카테고리가 없습니다. <a href="{CFG->PATH->WWWADMIN}/{module}/categoryAdd/{bseq}" class="icon_add_btn">추가</a>
				</td>
			</tr>
			{/}
		</tbody>
	</table>
	
	<div class="button_area">
		<a href="{action}/categoryAdd/{bseq}" class="category_add">추가</a>
	</div>
</section>